#pragma once
#include "objectmodel.h"
#include "pointlocator.h"

typedef std::map<int, object*> objectmap;
typedef std::pair<int, object*> obpair;

class MapDrawer
{
public:
	MapDrawer();
	MapDrawer(HWND const & hwnd);

	void clear();
	bool empty() const;
	void setHWND(HWND const & hWnd);
	HWND getHWND() const;
	void add(object * obj);
	void redraw() const;
	void setData(DBMaster const & data);
	DBMaster getData() const;

	void zoomIn();
	void zoomOut();
	void moveLeft();
	void moveRight();
	void moveTop();
	void moveBottom();
	void getTip(POINT point) const;

private:
	HDC dc_;
	objectmap objects_;
	HWND hwnd_;
	DBMaster data_;

	point_locator_t locator_;
	
	double scale_;
	double area_size_;
	point_t position_;

	void border() const;
	void draw() const;
};